#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int N,M,X,Y;
    cin>>N>>M>>X>>Y;
    vector<int> x,y;
    for(int i = 0; i<N; i++)
    {
        int temp;
        cin>>temp;
        if(X>temp)
        {
            for(int j = temp; j<X; j++)
                x.push_back(j);
        }
        else
        {
            for(int j = X; j<=temp; j++)
                x.push_back(j);
        }
    }
    for(int i = 0; i<M;i++)
    {
        int temp;
        cin>>temp;
        if(Y>temp)
        {
            for(int j = temp; j<Y; j++)
                y.push_back(j);
        }
        else
        {
            for(int j = Y; j<=temp; j++)
                y.push_back(j);
        }
    }
    bool bIfCross = false;
    for(int i = 0; i<x.size(); i++)
    {
        for(int j = 0; j<y.size(); j++)
        {
            if(x[i] == y[j])
            {
                bIfCross = true;
                break;
             }
        }
        
    }
    if(bIfCross)
    {
        cout<<X <<" and "<< Y<<": possible";
    }
    else
    {
        cout<<X << " and "<< Y << ": impossible";
    }
}